package com.weiqk.pmdemo.dao;

import com.weiqk.pmdemo.pojo.Dic;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

//@EnableJpaRepositories
@Component
public interface DicRepository extends PagingAndSortingRepository<Dic,Integer> {
    //通过材料代码查找字典
    @Query(value = "select DIC_NAME FROM PM_DIC where DIC_CODE=:n",nativeQuery = true)
    String findDicNameByDicCode(@Param("n") int DicCode);
}
